home *** CD-ROM | disk | FTP | other *** search
- #Options +B +E -G -H +J +K +Z
- #asm
- .verbose
- #endasm
- #include "MyTools.p"
- #include "MS.h"
- //============================
- MSPROC2(theMSP,menuID,itemNumber,flg)
- MSPtr theMSP;
- short menuID;
- short itemNumber,flg;
- //=========================
- BEGIN_FCT
- int i;
- short allocCount,fontNum,fontSize,byteOffSet,
- *paramPtr,paramCtr,limTab[2];
- short otherMenuID;
- MSHdl otherMSH;
- long **MIVTH;
- MenuHandle otherMH;
- Str255 fontName;
- short progNum=_MSPRG17;
-
- IF (NOT MSParsePROC(theMSP,0,limTab))
- THEN
- return (-3);
- ELSE
- allocCount=theMSP->allocCount;
- byteOffSet=_MSFIXLEN+(allocCount+1)*sizeof(MenuVerb);
- paramPtr=(short *)((char *)theMSP+byteOffSet);
- paramCtr=*paramPtr;
- if ( paramCtr LT 3)
- return(_MSMIVTER-1);
-
- IF (itemNumber EQ NULL)
- THEN
- for (i=limTab[0];i LE limTab[1];i++)
- if (BitTst(&theMSP->TF,i))
- break;
- itemNumber=i;
- ENDIF
- if (itemNumber LT limTab[0])
- itemNumber=limTab[0];
- if (itemNumber GT limTab[1])
- itemNumber=limTab[1];
-
- MIVTH=theMSP->MIVTH;
- fontNum=*(*MIVTH+itemNumber);
-
- otherMenuID=*(paramPtr+paramCtr);
- if ((otherMSH=(MSHdl)GetResource(_MSMSTTYP,otherMenuID)) EQ NIL)
- return (-4);
- if (NOT (otherMH=(*otherMSH)->MH))
- return (-4);
- HLock(otherMSH);
- MIVTH=(*otherMSH)->MIVTH;
- IF (NOT MSParsePROC(*otherMSH,0,limTab))
- THEN
- HUnlock(otherMSH);
- return (_MSMIVTER-1);
- ELSE
- FOR (i=limTab[0];i LE limTab[1];i++)
- fontSize=*(*MIVTH+i);
- if (RealFont(fontNum,fontSize))
- SetItemStyle(otherMH,i,outlineStyle);
- else
- SetItemStyle(otherMH,i,NULL);
- ENDFOR
- HUnlock(otherMSH);
- return (_MSMIVTOK);
- ENDIF
- ENDIF
- END_FCT
- main()
- {}